org.eclipse.vtp.framework.interactions.core.support
Class RawDocument

java.lang.Object
  extended by org.eclipse.vtp.framework.interactions.core.support.RawDocument
All Implemented Interfaces:
IDocument

public class RawDocument
extends java.lang.Object
implements IDocument

An output document backed by an in-memory XML stream.

Version:
3.0
Author:
Trip Gilman, Lonnie Pryor

Field Summary
 
Fields inherited from interface org.eclipse.vtp.framework.interactions.core.platforms.IDocument
DEFAULT_CONTENT_TYPE
 
Constructor Summary
RawDocument(java.lang.String documentType)
          Creates a new RawOutputDocument.
RawDocument(java.lang.String documentType, java.lang.String contentType)
          Creates a new RawOutputDocument.
 
Method Summary
 void appendText(java.lang.String text)
          Adds the given text to the end of the current document text.
 void clearText()
          Clears all the text contained in this document.
 java.lang.String getContentType()
          Returns a string representing the MIME type of XML document this instance produces.
 java.lang.String getDocumentType()
          Returns a string representing the dialect of XML document this instance produces.
 java.lang.String toString()
           
 javax.xml.transform.Source toXMLSource()
          Creates and returns an XML representation of this document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RawDocument

public RawDocument(java.lang.String documentType)
Creates a new RawOutputDocument.

Parameters:
documentType - The the type of XML document this instance contains.

RawDocument

public RawDocument(java.lang.String documentType,
                   java.lang.String contentType)
Creates a new RawOutputDocument.

Parameters:
documentType - The the type of XML document this instance contains.
Method Detail

appendText

public void appendText(java.lang.String text)
Adds the given text to the end of the current document text.

Parameters:
text - The text to add.

clearText

public void clearText()
Clears all the text contained in this document.


getDocumentType

public java.lang.String getDocumentType()
Description copied from interface: IDocument
Returns a string representing the dialect of XML document this instance produces.

Specified by:
getDocumentType in interface IDocument
Returns:
A string representing the dialect of XML document this instance produces.

getContentType

public java.lang.String getContentType()
Description copied from interface: IDocument
Returns a string representing the MIME type of XML document this instance produces.

Specified by:
getContentType in interface IDocument
Returns:
A string representing the MIME type of XML document this instance produces.

toXMLSource

public javax.xml.transform.Source toXMLSource()
                                       throws java.lang.IllegalStateException
Description copied from interface: IDocument
Creates and returns an XML representation of this document.

Specified by:
toXMLSource in interface IDocument
Returns:
An XML transformation source object that can be used with the javax.xml.transform API.
Throws:
java.lang.IllegalStateException - If any aspect of this document's state prevents it from being transformed into XML.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object